package com.kang.c0c.tree.node;


/**
 * 抽象语法树的叶节点
 * 定义了这个叶节点的具体属性值
 * VAR		：存储变量的符号表信息
 * STRING	：存储字符串在全局符号表里位置
 * NUM		：存储常量的数值
 *
 * @author kang
 *
 * Feb 6, 2009
 */
public class LeafNode extends Node{
	private Object value;
	
	public LeafNode(){
		super();
	}
	
	public LeafNode(int node,Object value){
		super(node);
		this.value = value;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public boolean equal(LeafNode node){
		if(node == null)
			return false;
		
		if(this.getNode() == node.getNode())
			return this.value.equals(node.value);
		else
			return false;
	}
}
